public class BinaryNode {
	// Friendly data; accessible by other package routines
	private int key; // The data in the node
	BinaryNode left; // Left child
	BinaryNode right; // Right child

	/**
	 * Construct the node, with null at left and right. 
	 */

	public BinaryNode(int thekey) {
		key = thekey;
		left = right = null;
	}

	/**
	 * Public key getter
	 */
	
	public int getkey() {
		return key;
	}
	
	/**
	 * Public key setter
	 */
	
	public void setkey(int x){
		this.key = x;
	}

	public void Modifykey(int x) {
		this.key = x;
	}

	/**
	 * 
	 * @param int;
	 * when int is greater then current node key return 1;
	 * when int is smaller then current node key return -1;
	 * else return 0;
	 * 
	 */
	
	public int compareTo(int compared) {
		if (this.key < compared)
			return 1;
		if (this.key > compared)
			return -1;
		else
			return 0;
	}
}
